package com.zzty.springmybatis.DAO;

import java.util.List;

import javax.ws.rs.DELETE;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.zzty.springmybatis.entity.ClassGroup;
import com.zzty.springmybatis.entity.User;

public interface ClassGroupDAO {
	@Select("#{sql}")
	public List<ClassGroup> selectBySql(String sql);
	
	@Delete("delete from classgroup where class_id=#{class_id}")
	Integer delete(Integer clazzId);

	
	@Select("select * from user where clazzId=#{clazzId} and type is null")
	List<User> selectall(@Param("clazzId")String clazzId);
	
	@Select("select count(*) from user  where clazzId=#{clazzId} and type is null")
	Integer count(@Param("clazzId")Integer clazzId);

	
	@Insert("insert into classgroup (class_id,stu_ids) values(#{class_id},#{stu_ids})")
	Integer insertGroup(ClassGroup group);
	
	
}
